package pl.polidea.imf.blackberry.ui;

import pl.polidea.imf.blackberry.service.statemachine.State;

public class UiController {
	
	private StatusScreen statusScreen;
	private EnterUserDataPopupScreen enterUserDataPopupScreen;
	private ReportIssuePopUpScreen issuePopUpScreen;
	
	
	public void showStatusScreen(State state){
		if(statusScreen==null){
			statusScreen = new StatusScreen(state, this);
			GlobalUIHelper.pushGlobalScreen(statusScreen);
		}
		else{
			
		}
		
	}
	
	public void closeStatusScreen(){
		if(statusScreen!=null){
			statusScreen.close();
			statusScreen=null;
		}
	}
	
	
	public void showEnterUserData(){
		if(enterUserDataPopupScreen==null){
			enterUserDataPopupScreen = new EnterUserDataPopupScreen(this);
			GlobalUIHelper.pushGlobalScreen(enterUserDataPopupScreen);
		}
		else{
			
		}
		
	}
	
	public void closeEnterUserData(){
		if(enterUserDataPopupScreen!=null){
			enterUserDataPopupScreen.close();
			enterUserDataPopupScreen=null;
		}
	}
	
	public void showIssueReportPopUp(){
		if(issuePopUpScreen==null){
			issuePopUpScreen = new ReportIssuePopUpScreen(this);
			GlobalUIHelper.pushGlobalScreen(issuePopUpScreen);
		}
		else{
			
		}
		
	}
	
	public void closeIssueReportPopUp(){
		if(issuePopUpScreen!=null){
			issuePopUpScreen.close();
			issuePopUpScreen=null;
		}
	}
	
	
	
}
